package com.marmot.cloud.framework.biz.po;

import com.marmot.cloud.framework.orm.jpa.comment.annotation.Comment;
import com.marmot.cloud.framework.orm.jpa.entity.BaseJpaEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@Data
@EqualsAndHashCode(callSuper=false)
@Accessors(chain = true)
@Entity
@Table(name = "t_role")
@EntityListeners(AuditingEntityListener.class)
@Comment("角色信息表")
public class Role extends BaseJpaEntity {

    @Column(length = 30, nullable = false)
    @Comment("角色名称")
    private String roleName;

    @Column(length = 100, nullable = false)
    @Comment("角色权限字符串")
    private String roleKey;

    @Column(nullable = false)
    @Comment("显示顺序")
    private Integer roleSort;

    @Column(columnDefinition = "int default 1")
    @Comment("数据范围: 1=全部数据权限, 2=自定数据权限")
    private Integer dataScope;

    @Column
    @Comment("角色状态: 1=正常, 2=停用")
    private Integer status;

    @Column(length = 500)
    @Comment("备注")
    private String remark;

}

